3.10 \(\int (\frac{\cosh (a+b x-c x^2)}{x^2}-\frac{b \sinh (a+b x-c x^2)}{x}) \, dx\)

Optimal. Leaf size=108 \[ \frac{1}{2} \sqrt{\pi } \sqrt{c} e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )-\frac{1}{2} \sqrt{\pi } \sqrt{c} e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )-\frac{\cosh \left (a+b x-c x^2\right )}{x} \]

[Out]

-(Cosh[a + b*x - c*x^2]/x) + (Sqrt[c]*E^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/2 - (Sqrt[c]*E^
(-a - b^2/(4*c))*Sqrt[Pi]*Erfi[(b - 2*c*x)/(2*Sqrt[c])])/2

________________________________________________________________________________________

Rubi [A]  time = 0.0891469, antiderivative size = 108, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 35, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {5391, 5374, 2234, 2205, 2204} \[ \frac{1}{2} \sqrt{\pi } \sqrt{c} e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )-\frac{1}{2} \sqrt{\pi } \sqrt{c} e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )-\frac{\cosh \left (a+b x-c x^2\right )}{x} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[a + b*x - c*x^2]/x^2 - (b*Sinh[a + b*x - c*x^2])/x,x]

[Out]

-(Cosh[a + b*x - c*x^2]/x) + (Sqrt[c]*E^(a + b^2/(4*c))*Sqrt[Pi]*Erf[(b - 2*c*x)/(2*Sqrt[c])])/2 - (Sqrt[c]*E^
(-a - b^2/(4*c))*Sqrt[Pi]*Erfi[(b - 2*c*x)/(2*Sqrt[c])])/2

Rule 5391

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]*((d_.) + (e_.)*(x_))^(m_), x_Symbol] :> Simp[((d + e*x)^(m + 1)*Co
sh[a + b*x + c*x^2])/(e*(m + 1)), x] + (-Dist[(2*c)/(e^2*(m + 1)), Int[(d + e*x)^(m + 2)*Sinh[a + b*x + c*x^2]
, x], x] - Dist[(b*e - 2*c*d)/(e^2*(m + 1)), Int[(d + e*x)^(m + 1)*Sinh[a + b*x + c*x^2], x], x]) /; FreeQ[{a,
 b, c, d, e}, x] && LtQ[m, -1] && NeQ[b*e - 2*c*d, 0]

Rule 5374

Int[Sinh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] - Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2205

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erf[(c + d*x)*Rt[-(b*Log[F]),
 2]])/(2*d*Rt[-(b*Log[F]), 2]), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rubi steps

\begin{align*} \int \left (\frac{\cosh \left (a+b x-c x^2\right )}{x^2}-\frac{b \sinh \left (a+b x-c x^2\right )}{x}\right ) \, dx &=-\left (b \int \frac{\sinh \left (a+b x-c x^2\right )}{x} \, dx\right )+\int \frac{\cosh \left (a+b x-c x^2\right )}{x^2} \, dx\\ &=-\frac{\cosh \left (a+b x-c x^2\right )}{x}-(2 c) \int \sinh \left (a+b x-c x^2\right ) \, dx\\ &=-\frac{\cosh \left (a+b x-c x^2\right )}{x}-c \int e^{a+b x-c x^2} \, dx+c \int e^{-a-b x+c x^2} \, dx\\ &=-\frac{\cosh \left (a+b x-c x^2\right )}{x}+\left (c e^{-a-\frac{b^2}{4 c}}\right ) \int e^{\frac{(-b+2 c x)^2}{4 c}} \, dx-\left (c e^{a+\frac{b^2}{4 c}}\right ) \int e^{-\frac{(b-2 c x)^2}{4 c}} \, dx\\ &=-\frac{\cosh \left (a+b x-c x^2\right )}{x}+\frac{1}{2} \sqrt{c} e^{a+\frac{b^2}{4 c}} \sqrt{\pi } \text{erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )-\frac{1}{2} \sqrt{c} e^{-a-\frac{b^2}{4 c}} \sqrt{\pi } \text{erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )\\ \end{align*}

Mathematica [A]  time = 9.15112, size = 136, normalized size = 1.26 \[ \frac{1}{2} \left (-\sqrt{\pi } \sqrt{c} \text{Erf}\left (\frac{2 c x-b}{2 \sqrt{c}}\right ) \left (\sinh \left (a+\frac{b^2}{4 c}\right )+\cosh \left (a+\frac{b^2}{4 c}\right )\right )+\sqrt{\pi } \sqrt{c} \text{Erfi}\left (\frac{2 c x-b}{2 \sqrt{c}}\right ) \left (\cosh \left (a+\frac{b^2}{4 c}\right )-\sinh \left (a+\frac{b^2}{4 c}\right )\right )-\frac{2 \cosh (a+x (b-c x))}{x}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[a + b*x - c*x^2]/x^2 - (b*Sinh[a + b*x - c*x^2])/x,x]

[Out]

((-2*Cosh[a + x*(b - c*x)])/x + Sqrt[c]*Sqrt[Pi]*Erfi[(-b + 2*c*x)/(2*Sqrt[c])]*(Cosh[a + b^2/(4*c)] - Sinh[a
+ b^2/(4*c)]) - Sqrt[c]*Sqrt[Pi]*Erf[(-b + 2*c*x)/(2*Sqrt[c])]*(Cosh[a + b^2/(4*c)] + Sinh[a + b^2/(4*c)]))/2

________________________________________________________________________________________

Maple [F]  time = 0.111, size = 0, normalized size = 0. \begin{align*} \int{\frac{\cosh \left ( -c{x}^{2}+bx+a \right ) }{{x}^{2}}}-{\frac{b\sinh \left ( -c{x}^{2}+bx+a \right ) }{x}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(-c*x^2+b*x+a)/x^2-b*sinh(-c*x^2+b*x+a)/x,x)

[Out]

int(cosh(-c*x^2+b*x+a)/x^2-b*sinh(-c*x^2+b*x+a)/x,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{b \sinh \left (c x^{2} - b x - a\right )}{x} + \frac{\cosh \left (c x^{2} - b x - a\right )}{x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(-c*x^2+b*x+a)/x^2-b*sinh(-c*x^2+b*x+a)/x,x, algorithm="maxima")

[Out]

integrate(b*sinh(c*x^2 - b*x - a)/x + cosh(c*x^2 - b*x - a)/x^2, x)

________________________________________________________________________________________

Fricas [B]  time = 2.09882, size = 861, normalized size = 7.97 \begin{align*} -\frac{\sqrt{\pi }{\left (x \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) - x \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left (x \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) - x \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt{-c} \operatorname{erf}\left (\frac{{\left (2 \, c x - b\right )} \sqrt{-c}}{2 \, c}\right ) + \sqrt{\pi }{\left (x \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) + x \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left (x \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) + x \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt{c} \operatorname{erf}\left (\frac{2 \, c x - b}{2 \, \sqrt{c}}\right ) + \cosh \left (c x^{2} - b x - a\right )^{2} + 2 \, \cosh \left (c x^{2} - b x - a\right ) \sinh \left (c x^{2} - b x - a\right ) + \sinh \left (c x^{2} - b x - a\right )^{2} + 1}{2 \,{\left (x \cosh \left (c x^{2} - b x - a\right ) + x \sinh \left (c x^{2} - b x - a\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(-c*x^2+b*x+a)/x^2-b*sinh(-c*x^2+b*x+a)/x,x, algorithm="fricas")

[Out]

-1/2*(sqrt(pi)*(x*cosh(c*x^2 - b*x - a)*cosh(1/4*(b^2 + 4*a*c)/c) - x*cosh(c*x^2 - b*x - a)*sinh(1/4*(b^2 + 4*
a*c)/c) + (x*cosh(1/4*(b^2 + 4*a*c)/c) - x*sinh(1/4*(b^2 + 4*a*c)/c))*sinh(c*x^2 - b*x - a))*sqrt(-c)*erf(1/2*
(2*c*x - b)*sqrt(-c)/c) + sqrt(pi)*(x*cosh(c*x^2 - b*x - a)*cosh(1/4*(b^2 + 4*a*c)/c) + x*cosh(c*x^2 - b*x - a
)*sinh(1/4*(b^2 + 4*a*c)/c) + (x*cosh(1/4*(b^2 + 4*a*c)/c) + x*sinh(1/4*(b^2 + 4*a*c)/c))*sinh(c*x^2 - b*x - a
))*sqrt(c)*erf(1/2*(2*c*x - b)/sqrt(c)) + cosh(c*x^2 - b*x - a)^2 + 2*cosh(c*x^2 - b*x - a)*sinh(c*x^2 - b*x -
 a) + sinh(c*x^2 - b*x - a)^2 + 1)/(x*cosh(c*x^2 - b*x - a) + x*sinh(c*x^2 - b*x - a))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int - \frac{\cosh{\left (a + b x - c x^{2} \right )}}{x^{2}}\, dx - \int \frac{b \sinh{\left (a + b x - c x^{2} \right )}}{x}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(-c*x**2+b*x+a)/x**2-b*sinh(-c*x**2+b*x+a)/x,x)

[Out]

-Integral(-cosh(a + b*x - c*x**2)/x**2, x) - Integral(b*sinh(a + b*x - c*x**2)/x, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{b \sinh \left (-c x^{2} + b x + a\right )}{x} + \frac{\cosh \left (-c x^{2} + b x + a\right )}{x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(-c*x^2+b*x+a)/x^2-b*sinh(-c*x^2+b*x+a)/x,x, algorithm="giac")

[Out]

integrate(-b*sinh(-c*x^2 + b*x + a)/x + cosh(-c*x^2 + b*x + a)/x^2, x)